<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title></title>
<%@include file="/common/meta.jsp"%>
<%@include file="/common/ec.jsp"%>
</head>
<body>
<div class="x-panel-header">项目分类管理</div>
<div class="x-toolbar" style="padding:5px;">
  <c:choose>
    <c:when test="${param.modify eq 'finance'}">
	  &nbsp;&nbsp;项目类别预算配置
    </c:when>
    <c:otherwise>
      <a href="edit.do"><img src="${ctx}/images/icons/add.gif">&nbsp;添加分类 </a>&nbsp;&nbsp;
    </c:otherwise>
  </c:choose>
</div>
<%@ include file="/common/messages.jsp"%>
<ec:table items="items" var="item" retrieveRowsCallback="process" sortRowsCallback="process" 
	action="index.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="20" 
	editable="false"
	sortable="false" 
	rowsDisplayed="20" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="100%" 
	height="320px"
	minHeight="320"
	showHeader="true"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
		<ec:column width="40" property="_no." title="No." value="${GLOBALROWCOUNT}" style="text-align:center;" />
		<ec:column width="200" property="name" title="分类名称" ellipsis="true"/>
		<ec:column width="200" property="code" title="分类编号" cell="date" format="yyyy-MM-dd" />
		<ec:column width="120" property="_opt" title="操作" style="text-align:center;">
		  <c:choose>
		    <c:when test="${param.modify eq 'finance'}">
			  <a href="edit.do?model.id=${item.id}&isFinance=true" title="配置预算科目"><img src="${ctx}/images/icons/cog.png"></a>&nbsp;
		    </c:when>
		    <c:otherwise>
			  <a href="edit.do?model.id=${item.id}" title="编辑"><img src="${ctx}/images/icons/modify.gif"></a>&nbsp;
			  <a href="#" onclick="remove('${item.id}')" title="删除"><img src="${ctx}/images/icons/delete.gif"></a>
		    </c:otherwise>
		  </c:choose>
		</ec:column>
	</ec:row>
</ec:table>

<script type="text/javascript">
  function remove(id){
	  if (confirm("确实要删除该分类吗?")){
		  window.location.href = "remove.do?model.id=" + id;
	  }
  }
</script>
</body>
</html>